//
//  ChooseSexView.swift
//  loveHHEveryDay
//
//  Created by yw on 2025/4/7.
//

import SwiftUI

struct ChooseSexView: View {
    private let gradient = AngularGradient(
        gradient: Gradient(colors: [Color("color_pink_01"),Color("color_pink_02"),Color("color_pink_01")]),
        center: .center,
        startAngle: .degrees(360),
        endAngle: .degrees(0))
    @Binding var currentIndex:Int
    var list:[[String:String]]
    var body: some View {
        HStack(spacing:60) {
            ForEach(0..<list.count,id: \.self){ index in
                VStack {
                    Circle()
                        .stroke(gradient,style: StrokeStyle(lineWidth: currentIndex == index ? 4:0))
//                        .strokeBorder(currentIndex == index ? Color("color_pink_01"):Color.clear,lineWidth: 4)
                        .background(currentIndex == index ? Circle().foregroundColor(Color("color_wel_bg_01")):
                            Circle().foregroundColor(Color("color_wel_bg_02")))
                        .frame(width: currentIndex == index ? 108:100, height:  currentIndex == index ? 108:100)
                        .overlay {
                            Image(list[index]["icon"] ?? "")
                                .resizable()
                                .frame(width: currentIndex == index ? 72:68, height: currentIndex == index ? 72:68)
                                .aspectRatio(contentMode: .fill)
                                
                                
                        }
                    Text(list[index]["title"] ?? "")
                        .modifier(YWTextModifer(fontSize: 26, fontWeight: .bold, design: .rounded, color: Color("color_text_main")))
                }.shakeTapGes {
                    withAnimation {
                        currentIndex = index
                    }
                }
                
            }
        }
        .frame(maxWidth: .infinity)
        .frame(height:220)
        .padding(.vertical,80)
    }
}

